#README: advanced version of pic grabber, works through atomic2, modify board= to your need,
#in latest post that has pic attachments, the last pic attachment is saved
                                                                                                                                                                       
wget -O board.htm "http://www.newsmth.net/bbsdoc.php?board=picture"                                                                                                        
postnum=`cat board.htm |grep " @" | tail -1 | sed -e "s/c\.o(//g" | sed -e "s/,.*);//g" ; `                                                                            
                                                                                                                                                                       
httpprefix="http://www.newsmth.net/atomic2.php?act=article&board=picture&id="                                                                                              
#act=article is fixed; board= pict*re/piel*ve/myph*to, etc need adjust to your needs                                                                                   
                                                                                                                                                                       
posthttp=$httpprefix$postnum                                                                                                                                           
#echo $postnum                                                                                                                                                          
#echo $posthttp                                                                                                                                                         
                                                                                                                                                                       
wget -O post.htm $posthttp                                                                                                                                             
pichttp=`cat post.htm |grep "att\.php" | tail -1 | sed -e "s/.*att\.php/http:\/\/www\.newsmth\.net\/att\.php/g" | sed -e "s/' target='_blank'.*//g"; `                 
                                                                                                                                                                       
#echo $pichttp                                                                                                                                                          
                                                                                                                                                                       
wget -O latestpic $pichttp                                                                                                                                             
rm -f pic_latest-*.jpg                                                                                                                                                 
convert -resize 640x480 latestpic pic_latest.jpg                                                                                                                       
rm -f latestpic

